package com.heima.ssm.utils;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * @author Penguin
 * @create Date 2021/5/6  Time 14:05
 */
public class PasswordEncoderUtils {
    private static BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
    public static String getPwd(String password){
        return bCryptPasswordEncoder.encode(password);
    }


    public static void main(String[] args) {
        String s = "123";
        String pwd = getPwd(s);
        System.out.println("pwd = " + pwd);
        //pwd = $2a$10$871Fg2//wzdWq8IH87tNauYWk2YVSFcuSAMwg85BaLigcgdinPmqe
        //pwd = $2a$10$0FwQxytJ/bIkKFERI5M/5uSBMrSEJzmm.xl/9djV9pUGw1T2c3gsm
        System.out.println(pwd.length());
    }
}